import numpy as np
from pylab import *
import matplotlib.pyplot as plt
import matplotlib.cm as cm

class vis:
    
    def plot1(self,xdata,ydata):
        plot(xdata,ydata)
        plt.show()
        
    def plot2(self,table):
        fig, ax = plt.subplots()
        ax.imshow(table, cmap = cm.jet, interpolation = 'nearest')
        plt.gca().invert_yaxis()
        plt.show()
        
    def subs(self, hit_table, stand_table, policy_table):
        ax1 = plt.subplot(1,3,1)
        ax1.imshow(hit_table, cmap = cm.jet, interpolation = 'nearest')
        ax1.set_title("Hit Q-Values")
        ax1.set_xlabel("Dealer Card Value")
        ax1.set_ylabel("Agent Cards Value")
        plt.gca().invert_yaxis()
        
        ax2 = plt.subplot(1,3,2)
        ax2.imshow(stand_table, cmap = cm.jet, interpolation = 'nearest')
        ax2.set_title("Stand Q-Values")
        ax2.set_xlabel("Dealer Card Value")
        plt.gca().invert_yaxis()
        
        ax3 = plt.subplot(1,3,3)
        ax3.imshow(policy_table, cmap = cm.jet, interpolation = 'nearest')
        ax3.set_title("Policy")
        ax3.set_xlabel("Dealer Card Value")
        plt.gca().invert_yaxis()
        
        plt.show()
        